
<?php $this->headScript()->appendFile($this->JS_PATH . 'loan.js'); ?>
<?php $this->headScript()->appendFile($this->JS_PATH . 'bootstrap.datepicker.js'); ?>

<div id="loan-listing"></div>
<div class="container-fluid">
    <div id="pad-wrapper" class="form-page">
        <div class="row-fluid form-wrapper">
            <div class="span column">
                <?php if ($this->successmessage != ''): ?>
                    <div class="alert alert-success">
                        <i class="icon-ok-sign"></i> <?php echo $this->successmessage; ?>
                    </div>
                <?php endif; ?>

                <?php if (count($this->errorMessageArray) > 0): ?>
                    <div class="alert alert-error">
                        <?php foreach ($this->errorMessageArray as $erroValue): ?>

                            <div class="text-left">
                                <i class="icon-remove-sign"></i>
                                <?php echo $erroValue; ?>
                            </div>

                        <?php endforeach; ?>
                    </div>
                <?php endif; ?>
                <div class="loan_div">
                <form role="form"  id="loan-form" name="loan-form"  enctype="multipart/form-data"  action="" method="post">
                    <div class="field-box">
                        <label>Name<span class="error-star">*</span>:</label>

                        <?php echo $this->form->ln_name; ?>
                    </div>
                    
                    <div class="field-box">
                        <label>Customer Name:<span class="error-star">*</span>:</label>
                        <div class="ui-select">
                            <?php echo $this->form->ln_cus_id; ?>
                        </div>
                    </div>
                   
                    <div class="field-box">
                        <label>Agent Name<span class="error-star">*</span>:</label>
                        <div class="ui-select">
                            <?php echo $this->form->ln_ag_id; ?>
                        </div>
                    </div>
                    
                    <div class="field-box">
                        <label>Amount (INR)<span class="error-star">*</span>:</label>
                        <?php echo $this->form->ln_amount; ?>
                    </div>
                    
                    <div class="field-box">
                        <label>Advance Amount (INR)<span class="error-star">*</span>:</label>
                        <?php echo $this->form->ln_advance; ?>
                    </div>
                    
                    
                    <div class="field-box">
                        <label>Start Date<span class="error-star">*</span>:</label>
                        <?php echo $this->form->ln_startdate; ?>
                    </div>
                    
                    
                    <div class="field-box">
                        <label>End Date<span class="error-star">*</span>:</label>
                        <?php echo $this->form->ln_enddate; ?>
                    </div>
                    
                    <div class="field-box">
                        <label>Document<span class="error-star">*</span>:</label>
                        <input type="file" name="ln_document" id="ln_document" />
                        &nbsp;
                        <?php if($this->loanid && $this->docname!=''):?>
                        <input type="button" value="Download Document" class="btn-flat success"
                               onclick="window.location='<?php echo $this->url(array('controller' => 'loan', 'action' => 'download', 'ln_id' => $this->loanid), null, TRUE) ?>'"
                               >
                        <?php endif;?>
                    </div>
                    
                    <div class="field-box">
                        <label>Guarantor Name:</label>
                        <?php echo $this->form->ln_guarantor_name; ?>
                    </div>
                    
                    <div class="field-box">
                        <label>Guarantor Address:</label>
                        <?php echo $this->form->ln_guarantor_address; ?>
                    </div>
                    
                    <div class="field-box">
                        <label>Guarantor Mobile:</label>
                        <?php echo $this->form->ln_guarantor_mobile; ?>
                    </div>
                    
                    <div class="field-box">
                        <label>Note:</label>
                        <?php echo $this->form->ln_note; ?>
                    </div>
                   
                    <div class="field-box">
                        <label>Status<span class="error-star">*</span>:</label>
                        <div class="ui-select">
                            <?php echo $this->form->ln_status; ?>
                        </div> 
                    </div>

                    <br>

                    <div class="field-box">
                        <?php echo $this->form->Save; ?>
                        <?php echo $this->form->Reset; ?> 
                    </div>
                </form>
                </div>
            </div>
        </div>
    </div>
</div>
